package cn.juforg.gobang.player;

import cn.juforg.gobang.ChessBoard;

/**
 * @author Juforg
 * 工厂类，根据参数创建不同等级的电脑
 */
public class AIFactory {
	public static BasePlayer getInstance(int level){
		BasePlayer ai ;
		switch (level) {
		case 3:
			ai = new Lufu(ChessBoard.PLAYER2FLAG);
			break;
		case 2:
			ai = new Zoro(ChessBoard.PLAYER2FLAG);
			break;
		case 0:
			ai = new Nami(ChessBoard.PLAYER2FLAG);
			break;
		case 1:
			ai = new Robin(ChessBoard.PLAYER2FLAG);
			break;
		default:
			ai = new Lufu(ChessBoard.PLAYER2FLAG);
		}
		return ai;
	}
}
